//
//  YMMineService.m
//  YMMedical
//
//  Created by y s on 2023/7/13.
//

#import "YMMineService.h"
#import "YMNetwork.h"
#import "YMMedicalTools.h"

@implementation YMMineService

//常见问题
+ (void)requestMineQuestionListDataPageNo:(NSInteger)pageNo
                                  success:(void(^)(NSArray *arrData))success
                                  failure:(void(^)(NSString *message))failure{
    
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/getFormList"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"993ea78e0dc043f8a8e53fda92ddf62f"forKey:@"formheaduuid"];
    [dict setValue:@1 forKey:@"needpage"];
    [dict setValue:@(pageNo) forKey:@"page"];
    [dict setValue:@20 forKey:@"pagesize"];
    
    NSMutableDictionary *dictField1 = [[NSMutableDictionary alloc] init];
    NSString *languageStr = [YMLanguageUtil isEnglish] ? @"ecdfe448-5f60-477b-ac71-75a3711463a1":@"b6dc88f5-0dd3-4525-80f1-87cf92f0a56e";
    [dictField1 setValue:@"e1i8oa6zppxb2ypy" forKey:@"key"];
    [dictField1 setValue:languageStr forKey:@"value"];
    [dict setValue:@[dictField1] forKey:@"filters"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSArray *arrTemp = [[NSArray alloc] init];
            if (dict != nil){
                arrTemp = [SDataUtil arrayOf:dict[@"data"]];
            }
            if (success){
                success(arrTemp);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}
//关于我们
+ (void)requestMineAboutUsSuccess:(void(^)(NSString *contentStr))success
                           failure:(void(^)(NSString *message))failure{
    
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/getFormList"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"7cd85796e89f4c808cbf6ad0418f9db3"forKey:@"formheaduuid"];
    [dict setValue:@0 forKey:@"needpage"];
    [dict setValue:@1 forKey:@"page"];
    [dict setValue:@20 forKey:@"pagesize"];

    NSMutableDictionary *dictField1 = [[NSMutableDictionary alloc] init];
    NSString *languageStr = [YMLanguageUtil isEnglish] ? @"fc53d4e5-2d1f-4fb6-a301-c3be273a60cf":@"ebc44d27-10d7-49a0-be32-d5fedf38b07a";
    [dictField1 setValue:@"68zh7koqmbrui0un" forKey:@"key"];
    [dictField1 setValue:languageStr forKey:@"value"];
    
    [dict setValue:@[dictField1] forKey:@"filters"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSString *contentStr = @"";
            if (dict != nil){
                NSArray *arrTemp = [SDataUtil arrayOf:dict[@"data"]];
                if (arrTemp.count > 0){
                    NSDictionary *dictTemp = [SDataUtil dictOf:arrTemp.firstObject];
                    if (dictTemp != nil){
                        contentStr = [SDataUtil stringOf:dictTemp[@"1log55b3hbdbo0vm"] valid:@""];
                    }
                }
            }
            if (success){
                success(contentStr);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}
//操作手册
+ (void)requestMineProductSpecificationPageNo:(NSInteger)pageNo
                                      success:(void(^)(NSArray *arrData))success
                                      failure:(void(^)(NSString *message))failure{
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/getFormList"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"a5dfbf68671c420088f9342b38cb1843"forKey:@"formheaduuid"];
    [dict setValue:@1 forKey:@"needpage"];
    [dict setValue:@(pageNo) forKey:@"page"];
    [dict setValue:@20 forKey:@"pagesize"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:@"nolbzw5xemf0md5e" forKey:@"key"];
    [dictField setValue:@"fd6f87d5-b60c-4474-85d8-d2241227b8c4" forKey:@"value"];
    
    NSMutableDictionary *dictField1 = [[NSMutableDictionary alloc] init];
    NSString *languageStr = [YMLanguageUtil isEnglish] ? @"2bc875cb-4a14-4cc0-8c56-b22103a60298":@"19cc4581-b379-4566-b2f5-c45dc411d640";
    [dictField1 setValue:@"5hn0b3bilpmmxm83" forKey:@"key"];
    [dictField1 setValue:languageStr forKey:@"value"];
    
    [dict setValue:@[dictField,dictField1] forKey:@"filters"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSArray *arrData = [[NSArray alloc] init];
            if (dict != nil){
                arrData = [SDataUtil arrayOf:dict[@"data"]];
            }
            if (success){
                success(arrData);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}
//意见反馈
+ (void)requestFeedbackDataWithContent:(NSString *)contentStr
                               imgUrls:(NSArray *)imgUrls
                               success:(void(^)(void))success
                               failure:(void(^)(NSString *message))failure{
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/addFormRow"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"79595e9b07b1497baa2a5fa6057ae27d" forKey:@"formheaduuid"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:[SDataUtil stringOf:[YMMyModel shared].userId valid:@""] forKey:@"1wlj8mtymk1ffoxh"];
    [dictField setValue:[SDataUtil stringOf:contentStr valid:@""] forKey:@"haj7s4fmmy2y9qlt"];
    [dictField setValue:[SDataUtil stringOf:[YMMyModel shared].userPhone valid:@""] forKey:@"lh3uyhcr7mhsdnrx"];
    NSString *imgAllStr = @"";
    for (NSString *subStr in imgUrls){
        if (imgUrls == nil || imgAllStr.length < 1){
            imgAllStr = subStr;
        }else{
            imgAllStr = [imgAllStr stringByAppendingFormat:@",%@",subStr];
        }
    }
    [dictField setValue:imgAllStr forKey:@"qhbytc1gxuq2nzba"];
    [dict setValue:dictField forKey:@"fields"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            if (success){
                success();
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}

//我的设备列表
+ (void)requestMineMyDeviceListDataWithPage:(NSInteger)pageNo
                                    success:(void(^)(NSArray *arrData))success
                                    failure:(void(^)(NSString *message))failure{

    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/getFormList"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"2582bc4c14914246807a26886f46dd0e" forKey:@"formheaduuid"];
    [dict setValue:@1 forKey:@"needpage"];
    [dict setValue:@(pageNo) forKey:@"page"];
    [dict setValue:@20 forKey:@"pagesize"];
    [dict setValue:@"created_at" forKey:@"sortid"];
    [dict setValue:@1 forKey:@"isasc"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:@"ope0wk2ysioftswt" forKey:@"key"];
    [dictField setValue:[YMMyModel shared].userId forKey:@"value"];
    [dict setValue:@[dictField] forKey:@"filters"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSArray *arrTemp = [[NSArray alloc] init];
            if (dict != nil){
                arrTemp = [SDataUtil arrayOf:dict[@"data"]];
            }
            if (success){
                success(arrTemp);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}
//设备绑定的用户列表
+ (void)requestMineDeviceBindAccountListDataWithPage:(NSInteger)pageNo
                                            needpage:(NSInteger)needpage
                                              snCode:(NSString *)snCode
                                             success:(void(^)(NSArray *arrData))success
                                             failure:(void(^)(NSString *message))failure{

    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/getFormList"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"2582bc4c14914246807a26886f46dd0e" forKey:@"formheaduuid"];
    [dict setValue:@(needpage) forKey:@"needpage"];
    [dict setValue:@(pageNo) forKey:@"page"];
    [dict setValue:@20 forKey:@"pagesize"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:@"bhmohipntdlpc61m" forKey:@"key"];
    [dictField setValue:[SDataUtil stringOf:snCode valid:@""] forKey:@"value"];
    [dict setValue:@[dictField] forKey:@"filters"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSArray *arrTemp = [[NSArray alloc] init];
            if (dict != nil){
                arrTemp = [SDataUtil arrayOf:dict[@"data"]];
            }
            if (success){
                success(arrTemp);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}

//删除设备
+ (void)requestMineDeleteDeviceWithRowId:(NSString *)rowId
                                 success:(void(^)(void))success
                                 failure:(void(^)(NSString *message))failure{
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/deleteFormRow"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"2582bc4c14914246807a26886f46dd0e" forKey:@"formheaduuid"];
    [dict setValue:[SDataUtil stringOf:rowId valid:@""] forKey:@"rowid"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            if (success){
                success();
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}

//被测人列表数据
+ (void)requestMineTesteeListDataWithPage:(NSInteger)pageNo
                                 needpage:(NSInteger)needpage
                                  success:(void(^)(NSArray *arrData))success
                                  failure:(void(^)(NSString *message))failure{

    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/getFormList"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"83ed64e98f6c4edbaf7b388d7691e57b" forKey:@"formheaduuid"];
    [dict setValue:@(needpage) forKey:@"needpage"];
    [dict setValue:@(pageNo) forKey:@"page"];
    [dict setValue:@20 forKey:@"pagesize"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:@"61xugqtzoyid5pw2" forKey:@"key"];
    [dictField setValue:[SDataUtil stringOf:[YMMyModel shared].userId valid:@""] forKey:@"value"];
    [dict setValue:@[dictField] forKey:@"filters"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSArray *arrTemp = [[NSArray alloc] init];
            if (dict != nil){
                arrTemp = [SDataUtil arrayOf:dict[@"data"]];
            }
            if (success){
                success(arrTemp);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}
//被测人管理查询接口
+ (void)requestMineTesteeManagerSearchDataWithName:(NSString *)name
                                           success:(void(^)(NSArray *arrData))success
                                           failure:(void(^)(NSString *message))failure{

    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/getFormList"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"83ed64e98f6c4edbaf7b388d7691e57b" forKey:@"formheaduuid"];
    [dict setValue:@(0) forKey:@"needpage"];
    [dict setValue:@(1) forKey:@"page"];
    [dict setValue:@20 forKey:@"pagesize"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:@"61xugqtzoyid5pw2" forKey:@"key"];
    [dictField setValue:[SDataUtil stringOf:[YMMyModel shared].userId valid:@""] forKey:@"value"];
    [dictField setValue:@"8pa55qzbspju5tzn" forKey:@"key"];
    [dictField setValue:[SDataUtil stringOf:name valid:@""] forKey:@"value"];
    [dict setValue:@[dictField] forKey:@"filters"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSArray *arrTemp = [[NSArray alloc] init];
            if (dict != nil){
                arrTemp = [SDataUtil arrayOf:dict[@"data"]];
            }
            if (success){
                success(arrTemp);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}
//新增被测人
+ (void)requestMineAddNewTesteeWithName:(NSString *)name
                                 height:(NSString *)height
                                    sex:(NSString *)sex
                                   year:(NSString *)year
                                 weight:(NSString *)weight
                                 success:(void(^)(NSString *idStr))success
                                 failure:(void(^)(NSString *message))failure{
    
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/addFormRow"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"83ed64e98f6c4edbaf7b388d7691e57b" forKey:@"formheaduuid"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:[SDataUtil stringOf:[YMMyModel shared].userId valid:@""] forKey:@"61xugqtzoyid5pw2"];
    [dictField setValue:[SDataUtil stringOf:name valid:@""] forKey:@"8pa55qzbspju5tzn"];
    [dictField setValue:[SDataUtil stringOf:height valid:@""] forKey:@"cu8thtdjxhfbxpjx"];
    [dictField setValue:[SDataUtil stringOf:sex valid:@""] forKey:@"kpurkwtmvsd9lqui"];
    [dictField setValue:[SDataUtil stringOf:year valid:@""] forKey:@"orldw605kccdju8z"];
    [dictField setValue:[SDataUtil stringOf:[YMMedicalTools calculateYearToNow:year] valid:@""] forKey:@"sh17nlmfo9g6vzrh"];
    [dictField setValue:[SDataUtil stringOf:weight valid:@""] forKey:@"yzqfbls6zzqh9tyl"];
    [dict setValue:dictField forKey:@"fields"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSString *idStr = @"";
            if (dict != nil){
                idStr = [SDataUtil stringOf:dict[@"id"] valid:@""];
            }
            if (success){
                success(idStr);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}

//删除被测人
+ (void)requestMineDeleteTesteeWithRowId:(NSString *)rowId
                                 success:(void(^)(void))success
                                 failure:(void(^)(NSString *message))failure{
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/deleteFormRow"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"83ed64e98f6c4edbaf7b388d7691e57b" forKey:@"formheaduuid"];
    [dict setValue:[SDataUtil stringOf:rowId valid:@""] forKey:@"rowid"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            if (success){
                success();
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}
//编辑被测人
+ (void)requestMineEditTesteeInformationWithName:(NSString *)name
                                          height:(NSString *)height
                                             sex:(NSString *)sex
                                            year:(NSString *)year
                                          weight:(NSString *)weight
                                           rowid:(NSString *)rowid
                                         success:(void(^)(NSString *idStr))success
                                         failure:(void(^)(NSString *message))failure{
    NSString *url = [KTuoToUrl stringByAppendingString:@"/appsheets/sheetapi/editFormRowById"];
    NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
    [dict setValue:@"13aa4626c7014c1b93136c038019db8c" forKey:@"applicationid"];
    [dict setValue:@"83ed64e98f6c4edbaf7b388d7691e57b" forKey:@"formheaduuid"];
    [dict setValue:[SDataUtil stringOf:rowid valid:@""] forKey:@"rowid"];
    
    NSMutableDictionary *dictField = [[NSMutableDictionary alloc] init];
    [dictField setValue:[SDataUtil stringOf:name valid:@""] forKey:@"8pa55qzbspju5tzn"];
    [dictField setValue:[SDataUtil stringOf:height valid:@""] forKey:@"cu8thtdjxhfbxpjx"];
    [dictField setValue:[SDataUtil stringOf:sex valid:@""] forKey:@"kpurkwtmvsd9lqui"];
    [dictField setValue:[SDataUtil stringOf:year valid:@""] forKey:@"orldw605kccdju8z"];
    [dictField setValue:[SDataUtil stringOf:weight valid:@""] forKey:@"yzqfbls6zzqh9tyl"];
    [dict setValue:dictField forKey:@"fields"];
    
    [YMNetwork postWithUrl:url parameters:dict success:^(id  _Nonnull data) {
        NSString *status = [SDataUtil stringOf:data[@"status"]];
        if ([YMNetwork tuoTuSuccess:status]){
            NSDictionary *dict = [SDataUtil dictOf:data[@"result"]];
            NSString *idStr = @"";
            if (dict != nil){
                idStr = [SDataUtil stringOf:dict[@"id"] valid:@""];
            }
            if (success){
                success(idStr);
            }
        }else{
            NSString *msg = [SDataUtil stringOf:data[@"err_msg"] valid:KLanguage(@"net_error_later_retry")];
            if (failure){
                failure(msg);
            }
        }
    } failure:^(NSError * _Nonnull error) {
        if (failure){
            failure(KLanguage(@"net_error_later_retry"));
        }
    }];
}


@end
